
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>IconFont</title>
    <link rel="stylesheet" href="demo.css">
    <script src="iconfont.js"></script>

    <style type="text/css">
        .icon {
          /* 通过设置 font-size 来改变图标大小 */
          width: 1em; height: 1em;
          /* 图标和文字相邻时，垂直对齐 */
          vertical-align: -0.15em;
          /* 通过设置 color 来改变 SVG 的颜色/fill */
          fill: currentColor;
          /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
             normalize.css 中也包含这行 */
          overflow: hidden;
        }

    </style>
</head>
<body>
    <div class="main markdown">
        <h1>IconFont 图标</h1>
        <ul class="icon_lists clear">
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-zhuanfa"></use>
                    </svg>
                    <div class="name">转发</div>
                    <div class="fontclass">#icon-zhuanfa</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-sz"></use>
                    </svg>
                    <div class="name">设置</div>
                    <div class="fontclass">#icon-sz</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-tc"></use>
                    </svg>
                    <div class="name">退出</div>
                    <div class="fontclass">#icon-tc</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-yhm"></use>
                    </svg>
                    <div class="name">用户名</div>
                    <div class="fontclass">#icon-yhm</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-i1"></use>
                    </svg>
                    <div class="name">新闻</div>
                    <div class="fontclass">#icon-i1</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-xb"></use>
                    </svg>
                    <div class="name">性别</div>
                    <div class="fontclass">#icon-xb</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-iconfontluxian"></use>
                    </svg>
                    <div class="name">路线导航</div>
                    <div class="fontclass">#icon-iconfontluxian</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-mima"></use>
                    </svg>
                    <div class="name">密码</div>
                    <div class="fontclass">#icon-mima</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-wjl"></use>
                    </svg>
                    <div class="name">暂无记录</div>
                    <div class="fontclass">#icon-wjl</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-webxiaopang21"></use>
                    </svg>
                    <div class="name">选择</div>
                    <div class="fontclass">#icon-webxiaopang21</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-sj"></use>
                    </svg>
                    <div class="name">手机</div>
                    <div class="fontclass">#icon-sj</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-cp"></use>
                    </svg>
                    <div class="name">车牌号</div>
                    <div class="fontclass">#icon-cp</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-dingwei"></use>
                    </svg>
                    <div class="name">定位</div>
                    <div class="fontclass">#icon-dingwei</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-fabu2"></use>
                    </svg>
                    <div class="name">发布</div>
                    <div class="fontclass">#icon-fabu2</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-i7"></use>
                    </svg>
                    <div class="name">箭头</div>
                    <div class="fontclass">#icon-i7</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-tz"></use>
                    </svg>
                    <div class="name">通知</div>
                    <div class="fontclass">#icon-tz</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-i2"></use>
                    </svg>
                    <div class="name">消息</div>
                    <div class="fontclass">#icon-i2</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-pinglun"></use>
                    </svg>
                    <div class="name">评论</div>
                    <div class="fontclass">#icon-pinglun</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-leixing"></use>
                    </svg>
                    <div class="name">类型</div>
                    <div class="fontclass">#icon-leixing</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-i6"></use>
                    </svg>
                    <div class="name">箭头</div>
                    <div class="fontclass">#icon-i6</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-i5"></use>
                    </svg>
                    <div class="name">加号</div>
                    <div class="fontclass">#icon-i5</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-i3"></use>
                    </svg>
                    <div class="name">预约</div>
                    <div class="fontclass">#icon-i3</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-i4"></use>
                    </svg>
                    <div class="name">我的</div>
                    <div class="fontclass">#icon-i4</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-yuyin"></use>
                    </svg>
                    <div class="name">语音</div>
                    <div class="fontclass">#icon-yuyin</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-i9"></use>
                    </svg>
                    <div class="name">点赞</div>
                    <div class="fontclass">#icon-i9</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-cfmm"></use>
                    </svg>
                    <div class="name">重复密码</div>
                    <div class="fontclass">#icon-cfmm</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-4sbaoyang"></use>
                    </svg>
                    <div class="name">4S保养</div>
                    <div class="fontclass">#icon-4sbaoyang</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-gy"></use>
                    </svg>
                    <div class="name">关于我们</div>
                    <div class="fontclass">#icon-gy</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-csrq"></use>
                    </svg>
                    <div class="name">出生日期</div>
                    <div class="fontclass">#icon-csrq</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-fabu"></use>
                    </svg>
                    <div class="name">发布</div>
                    <div class="fontclass">#icon-fabu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-riqi"></use>
                    </svg>
                    <div class="name">日期</div>
                    <div class="fontclass">#icon-riqi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-check"></use>
                    </svg>
                    <div class="name">选择</div>
                    <div class="fontclass">#icon-check</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-xuanze"></use>
                    </svg>
                    <div class="name">选择</div>
                    <div class="fontclass">#icon-xuanze</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-pp"></use>
                    </svg>
                    <div class="name">品牌</div>
                    <div class="fontclass">#icon-pp</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-xilie"></use>
                    </svg>
                    <div class="name">系列日记</div>
                    <div class="fontclass">#icon-xilie</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-ql"></use>
                    </svg>
                    <div class="name">清理</div>
                    <div class="fontclass">#icon-ql</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-cl2"></use>
                    </svg>
                    <div class="name">车辆型号</div>
                    <div class="fontclass">#icon-cl2</div>
                </li>
            
        </ul>


        <h2 id="symbol-">symbol引用</h2>
        <hr>

        <p>这是一种全新的使用方式，应该说这才是未来的主流，也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
        这种用法其实是做了一个svg的集合，与另外两种相比具有如下特点：</p>
        <ul>
          <li>支持多色图标了，不再受单色限制。</li>
          <li>通过一些技巧，支持像字体那样，通过<code>font-size</code>,<code>color</code>来调整样式。</li>
          <li>兼容性较差，支持 ie9+,及现代浏览器。</li>
          <li>浏览器渲染svg的性能一般，还不如png。</li>
        </ul>
        <p>使用步骤如下：</p>
        <h3 id="-symbol-">第一步：引入项目下面生成的symbol代码：</h3>
        <pre><code class="lang-js hljs javascript"><span class="hljs-comment">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;</span></code></pre>
        <h3 id="-css-">第二步：加入通用css代码（引入一次就行）：</h3>
        <pre><code class="lang-js hljs javascript">&lt;style type=<span class="hljs-string">"text/css"</span>&gt;
.icon {
   width: <span class="hljs-number">1</span>em; height: <span class="hljs-number">1</span>em;
   vertical-align: <span class="hljs-number">-0.15</span>em;
   fill: currentColor;
   overflow: hidden;
}
&lt;<span class="hljs-regexp">/style&gt;</span></code></pre>
        <h3 id="-">第三步：挑选相应图标并获取类名，应用于页面：</h3>
        <pre><code class="lang-js hljs javascript">&lt;svg <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"icon"</span> aria-hidden=<span class="hljs-string">"true"</span>&gt;<span class="xml"><span class="hljs-tag">
  &lt;<span class="hljs-name">use</span> <span class="hljs-attr">xlink:href</span>=<span class="hljs-string">"#icon-xxx"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">use</span>&gt;</span>
</span>&lt;<span class="hljs-regexp">/svg&gt;
        </span></code></pre>
        <blockquote>
        <p>实际情况中"iconfont"（font-family）需要修改为你项目下的font-family。可以通过编辑项目查看，默认是"iconfont"。</p>
        </blockquote>
    </div>
</body>
</html>
